package views.swing;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import models.entities.Proveedor;

public class ABCProveedores extends GUIProveedores implements ActionListener{
	private JButton botonGuardar=new JButton("Guardar");
	private JButton botonCancelar=new JButton("Limpiar");
	private int actIn=0;
	public ABCProveedores(){
		inicializar();
	}
	
	public ABCProveedores(Proveedor proveedor, int n){
		super(proveedor);
		inicializar();
		actIn=n;
		
	}
	
	private void inicializar(){
		botonGuardar.addActionListener(this);
		botonCancelar.addActionListener(this);
		
		add(botonGuardar, "label");
		add(botonCancelar, "field");
	}
	
	public void actionPerformed(ActionEvent evt){
		if(evt.getSource()==botonGuardar){
			super.crearProveedor(actIn);
		}else{
			super.limpiar();
			
		}
	}
}

